import java.util.Scanner;
public class A10{
	public static void main(String[] args){
		//1.买飞机票
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入机票的原价");
		double originalPrice = sc.nextDouble();//sc.nextDouble()是从输入流中读取一个double类型(小数类型)的值并返回
		System.out.println("请输入当前的月份");
		int month = sc.nextInt();//sc.nextInt()是从输入流中读取一个int类型(整数类型)的值并返回
		System.out.println("请输入当前购买的舱位:true表示头等舱,false表示经济舱");
		boolean seat = sc.nextBoolean();//sc.nextBoolean()是从输入流中读取一个boolean类型(布尔类型)的值并返回
		double discountedPrice = planeTicket(originalPrice,month,seat);
		System.out.println("打折后的价格是:" + discountedPrice + "元");
		
		//1.买飞机票简化
		System.out.println("请输入机票的原价");
		double originalPrice1 = sc.nextDouble();
		System.out.println("请输入当前的月份");
		int month1 = sc.nextInt();
		System.out.println("请输入当前购买的舱位:true表示头等舱,false表示经济舱");
		boolean seat1 = sc.nextBoolean();
		double discountedPrice1 = 0;
		if(month1 >= 5 && month1 <= 10){
				discountedPrice1 = planeTicket1(originalPrice1,seat1,0.9,0.85);
		}else if((month1 >= 11 && month1 <= 12) || (month1 >= 1 && month1 <= 4)){
				discountedPrice1 = planeTicket1(originalPrice1,seat1,0.7,0.65);
		}else{
			System.out.println("输入月份不合法");
		}
		System.out.println("打折后的价格是:" + discountedPrice1 + "元");
	}
	
	//1.买飞机票:旺季(5-10月)头等舱9折,经济舱8.5折,淡季(11月到来年4月)头等舱7折,经济舱6.5折
	public static double planeTicket(double originalPrice,int month,boolean seat){
		if(month >= 5 && month <= 10 && seat){
			System.out.print("您购买的飞机票打9折");
			return (originalPrice*0.9);
		}else if(month >= 5 && month <= 10 && !seat){
			System.out.println("您购买的飞机票打8.5折");
			return (originalPrice*0.85);
		}else if(((month >= 11 && month <= 12) || (month >= 1 && month <= 4)) && seat){
			System.out.println("您购买的飞机票打7折");
			return (originalPrice*0.7);
		}else{
			System.out.println("您购买的飞机票打6.5折");
			return (originalPrice*0.65);
		}
	}
	
	//1.买飞机票简化
	public static double planeTicket1(double originalPrice1,boolean seat1,double v,double v1){
		if(seat1){
			System.out.println("您购买的飞机票打"+v*10+"折");
			return originalPrice1 * v;
		}else{
			System.out.println("您购买的飞机票打"+v1*10+"折");
			return originalPrice1 * v1;
		}
	}
	
	
	
	
	//
	
	
	
	
}